/*******************************************************************************
 * Copyright (c) 2006 CEA List.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     CEA List - initial API and implementation
 *******************************************************************************/
package com.cea.papyrus.diagram.classdiagram.editpart;

import org.eclipse.draw2d.PositionConstants;
import org.eclipse.gef.EditPart;
import org.eclipse.uml2.uml.Slot;

import com.cea.papyrus.core.PapyrusMessages;
import com.cea.papyrus.core.PapyrusPlugin;
import com.cea.papyrus.core.editor.ModelManager;
import com.cea.papyrus.core.editor.mouseoveraction.ActionHandleManager;
import com.cea.papyrus.core.editpart.FeatureListEditPart;
import com.cea.papyrus.core.ui.dialogs.PapyrusMessageDialog;
import com.cea.papyrus.diagraminterchange2.di2.GraphNode;

/**
 * 
 */
public class InstanceSpecificationListEditPart extends FeatureListEditPart implements EditPart {

	/**
	 * 
	 * 
	 * @param modelManager 
	 * @param graphnode 
	 */
	public InstanceSpecificationListEditPart(GraphNode graphnode,
			ModelManager modelManager) {
		super(graphnode, org.eclipse.uml2.uml.Slot.class, modelManager);
	}

	/* (non-Javadoc)
	 * @see com.cea.papyrus.common.editpart.FeatureListEditPart#createEditPolicies()
	 */
	/**
	 * 
	 */
	@Override
	protected void createEditPolicies() {
		super.createEditPolicies();

		// Install mouse hover
		ActionHandleManager actionMngr = new ActionHandleManager(this);
		try{
			actionMngr.addTool(PapyrusPlugin.creationToolFactory.getCombinedTemplateCreationToolEntry(
					PapyrusMessages.AddSlotCommand_Label
					, PapyrusMessages.AddSlotCommand_Description
					, Slot.class
					, null)
					, PositionConstants.EAST);
		}
		catch (Exception e) {
			PapyrusMessageDialog.display(e.getMessage(), e);
		}
	}
}
